/*
 * Copyright 2011 The Rusted Roof, LLC.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package org.proteusframework.platformservice.persistence.messagebean;

/**
 * Thrown to indicate that the message bean couldn't be processed by the persistence service that was handed the bean
 * because no matching message bean was registered with the given service. Message bean registration must occur during
 * the Pre-Registration lifecycle activity event when a persistence service is being instantiated; it is not possible
 * to dynamically register message beans after the persistence service's Post-Registration lifecycle activity event
 * has fired.
 *
 * @author Tacoma Four
 */
public final class UnrecognizedMessageBeanException extends RuntimeException
{
    private Class messageBean;

    public UnrecognizedMessageBeanException(String s, Class messageBean)
    {
        super(s);
        this.messageBean = messageBean;
    }

    public Class getMessageBean()
    {
        return messageBean;
    }
}
